package demo.util;

import java.util.Comparator;

import datamodel.QMarketSummary;

public class MarketsNameComparator implements
		Comparator<QMarketSummary> {

	@Override
	public int compare(QMarketSummary arg0, QMarketSummary arg1) {
		int res =arg0.getMenuPath().compareTo(arg1.getMenuPath());
		if (res == 0){
			res = arg0.getMarketName().compareTo(arg1.getMarketName());
			if (res ==0){
			res = arg0.getMarketID()-arg1.getMarketID();
			}
		}
		return res;
	}

}
